package com.wlc.mapper;

import com.wlc.pojo.Dept;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;

@Mapper
public interface DeptMapper {

    Long selectDeptCount(@Param("deptName") String deptName,
                         @Param("status") Integer status);

    List<Dept> selectDeptList(@Param("deptName") String deptName,
                              @Param("status") Integer status,
                              @Param("offset") Integer offset,
                              @Param("limit") Integer limit);
    Dept selectById(Long id);
    List<Dept> selectAll();
    List<Dept> selectByParentId(Long parentId);
    List<Dept> selectTree();
    int insert(Dept dept);
    int update(Dept dept);
    int deleteById(Long id);  // 改为物理删除
    int updateStatus(@Param("id") Long id, @Param("status") Integer status);
    boolean existsChildren(Long parentId);
}